<template>
  <div>
    <el-form label-width="100px" size="small" :label-position="left" v-if="form">
      <el-row :gutter="80" style="display: flex;flex-wrap: wrap">

        <el-col :span="8">
          <el-form-item label="送检单号：">
            <span>{{form.inspection_no}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="请验类型：">
            <span>{{form.inspection_type_name}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="检验目的：">
            <span>{{form.inspection_goal}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="项目名称：">
            <span>{{form.project_name}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="项目编号：">
            <span>{{form.project_no}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="检品名称：">
            <span>{{form.sample_info.name}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="批号：">
            <span>{{form.sample_info.batch_number	}}</span>
          </el-form-item>
        </el-col>



        <el-col :span="8">
          <el-form-item label="样品类型：">
            <span>{{form.sample_info.sample_type_info.same_type_name	}}</span>
          </el-form-item>
        </el-col>


        <el-col :span="8">
          <el-form-item label="CAS：">
            <span>{{form.sample_info.cas}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="生产日期：">
              <span
                v-if="form.sample_info.production_date">{{dateFormat1('yyyy-mm-dd ',form.sample_info.production_date)}}</span>
          </el-form-item>
        </el-col>


        <el-col :span="8">
          <el-form-item label="有效期：">
              <span
                v-if="form.sample_info.validity_date">{{dateFormat1('yyyy-mm-dd ',form.sample_info.validity_date)}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="经销商：">
            <span>{{form.sample_info.supplier}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="生产商：">
            <span>{{form.sample_info.producer}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="送检量：">
            <span>{{form.sample_num}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="送检量单位：">
            <span>{{form.sample_info.unit}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="批量：">
            <span>{{form.batch_num}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="批量单位：">
            <span>{{form.batch_unit}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="是否留样：">
            <span v-if="form.if_reserve_sample === 1">是</span>
            <span v-else>否</span>
          </el-form-item>
        </el-col>

        <el-col :span="8" v-if="form.if_reserve_sample === 1">
          <el-form-item label="贮存条件：">
            <span>{{form.storage_conditions}}</span>
          </el-form-item>
        </el-col>



<!--        <el-col :span="8">-->
<!--          <el-form-item label="来源：" prop="producer">-->
<!--            <span>{{form.source}}</span>-->
<!--          </el-form-item>-->
<!--        </el-col>-->

<!--        <el-col :span="8">-->
<!--          <el-form-item label="实验目的：" prop="producer">-->
<!--            <span>{{form.experiment_goal}}</span>-->
<!--          </el-form-item>-->
<!--        </el-col>-->

        <el-col :span="8">
          <el-form-item label="检验期限：">
              <span
                v-if="form.inspection_date">{{dateFormat1('yyyy-mm-dd',form.inspection_date)}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="检验项目：">
            <span>{{form.inspection_project	}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="是否返样：">
            <span v-if="form.if_return_sample === 0">否</span>
            <span v-if="form.if_return_sample === 1">是</span>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="备注：">
            <span>{{form.remark}}</span>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="检验依据：">
            <file-preview :file-list="form.quality_standard_file" :fileBtnOption="['preview']"/>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="厂检报告：">
            <file-preview :file-list="form.factory_inspection_report" :fileBtnOption="['preview']"/>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="合成路线：">
            <file-preview :file-list="form.synthetic_route" :fileBtnOption="['preview']"/>
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="附件：">
            <file-preview :file-list="form.enclosure" :fileBtnOption="['preview']"/>
          </el-form-item>
        </el-col>

      </el-row>
    </el-form>
  </div>
</template>

<script>
  export default {
    name: 'ruleForm',
    props: {
      form: {
        type: Object,
        default: function() {
          return {
            batch_num: null,
            batch_unit: '',
            quality_standard_type: 1,
            name: '',
            inspection_project: '',
            source: '自制', //来源
            experiment_goal: '', //实验目的
            inspection_goal_id: '',
            inspection_type: 'inspection_type_wg', //	请验类型  1 外购物料 2 自研产品
            inspection_type_name: '外购物料',
            project_name: '', //项目名称
            project_id: '', //项目id
            project_leader_name: '',
            project_leader_id: '',
            project_phases_id: '',
            sample_info: {
              validity_date: '',
              sample_type_info: {
                same_type_id: '',
                same_type_name: ''
              },
              unit: '',
              id: '',
              name: '',
              attr: '', //规格
              cas: '', //CAS 1
              supplier: '', //经销商1
              producer: '', //生产商1
              batch_number: '', //批号1
              production_date: '', //生产日期1
              sample_type_name: '', //检品名称
              sample_type_id: '' //检品id
            },
            quality_standard_file: [], //质量文件
            sample_num: null, //送检量
            inspection_goal: '', //检验目的
            project_no: '', //项目编号
            if_reserve_sample: 1, //是否留样   1 是  2 否
            storage_conditions: '', //储存条件
            inspection_date: '', //检验日期
            quality_standard_name: '', //检验项目名称
            quality_standard_id: '', //检验项目id
            remark: '', //备注
            enclosure: [], //附件,
            project_category_id: '', //项目类别id
            project_category_name: '', //项目类别
            sign_category_id: '', //申报类别id
            sign_category_name: '', //申报类别
            synthetic_route: [],//   合成路线
            factory_inspection_report: [],// 厂检报告
            if_return_sample: 0//是否反样  0 否 1 是   int
          }
        }
      }
    },
    data() {
      return {
        left: 'left'
      }
    },
    //是计算属性，也可以理解为一个方法。
    computed: {},

    //属性是手动定义的所需监听的值
    watch: {},

    //生命周期 - 创建完成（访问当前this实例）
    created() {
    },

    //生命周期 - 挂载完成（访问DOM元素）
    mounted() {
    },

    //是Vue实例对象上绑定的方法，供当前Vue组件作用域内使用，
    methods: {}

  }

</script>

<style scoped>
  /* @import url(); 引入css类 */
</style>
